package com.qd.system.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_login_user")
public class LoginUser extends Model<LoginUser> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "person_id", type = IdType.ASSIGN_ID)
    private String personId;
    /**
     * 账号
     */
    @TableField("account")
    private String account;
    /**
     * 密码
     */
    @TableField("password")
    private String password;
    /**
     * 姓名
     */
    @TableField("person_name")
    private String personName;
    /**
     * 身份证号
     */
    @TableField("id_card")
    private String idCard;
    /**
     * 手机号
     */
    @TableField("mobile")
    private String mobile;
    /**
     * 人员类型:0 人社局 1企业 2个人 3其他
     */
    @TableField("person_type")
    private String personType;
    /**
     * 用户性别
     */
    @TableField("sex")
    private String sex;
    /**
     * 用户邮箱
     */
    @TableField("email")
    private String email;
    /**
     * 用户头像
     */
    @TableField("avatar")
    private String avatar;
    /**
     * 账号状态:0正常 1停用
     */
    @TableField("state")
    private Integer state;
    /**
     * 最后登录IP
     */
    @TableField("login_ip")
    private String loginIp;
    /**
     * 最后登录时间
     */
    @TableField("login_date")
    private LocalDateTime loginDate;
    /**
     * 机构ID
     */
    @TableField("org_id")
    private String orgId;

    public void freeData() {
        this.personId = null;
        this.account = null;
        this.password = null;
        this.personName = null;
        this.idCard = null;
        this.mobile = null;
        this.personType = null;
        this.sex = null;
        this.email = null;
        this.avatar = null;
        this.state = null;
        this.loginIp = null;
        this.loginDate = null;
        this.orgId = null;
    }

}
